﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DAL;

/// <summary>
/// Summary description for MenuBO
/// </summary>
public class MenuBO : DTPReportDataContext
{
	public MenuBO()
	{
		//
		// TODO: Add constructor logic here
		//
	}

    public List<PRC_DTP_MENU_GETBY_USERID_AND_MSMENUPARENTResult> Menu_GetBy_UserIDAndMSMenuParent(int UserID, int MSMenuParent)
    {
        try
        {
            List<PRC_DTP_MENU_GETBY_USERID_AND_MSMENUPARENTResult> result = new List<PRC_DTP_MENU_GETBY_USERID_AND_MSMENUPARENTResult>();
            result = PRC_DTP_MENU_GETBY_USERID_AND_MSMENUPARENT(UserID, MSMenuParent).ToList();
            return result;
        }
        catch (Exception ex)
        {
            return null;
        }
    }
    public List<PRC_DTP_MENU_GETBY_MSMENUPARENTResult> Menu_GetBy_MSMenuParent(int userId,int MSMenuParent)
    {
        try
        {
            List<PRC_DTP_MENU_GETBY_MSMENUPARENTResult> result = new List<PRC_DTP_MENU_GETBY_MSMENUPARENTResult>();
            result = PRC_DTP_MENU_GETBY_MSMENUPARENT(userId,MSMenuParent).ToList();
            return result;
        }
        catch (Exception ex)
        {
            return null;
        }
    }

    public List<PRC_DTP_MENU_GET_PERMISSIONResult> Menu_Get_Permission(int MsBoPhan)
    {
        try
        {
            List<PRC_DTP_MENU_GET_PERMISSIONResult> result = new List<PRC_DTP_MENU_GET_PERMISSIONResult>();
            result = PRC_DTP_MENU_GET_PERMISSION(MsBoPhan).ToList();
            return result;
        }
        catch (Exception ex)
        {
            return null;
        }
    }

    public List<PRC_DTP_MENU_GET_PERMISSION_GETCHILD_BYMENUIDResult> Menu_Get_Permission_Detail(int menuparent,int MsBoPhan)
    {
        try
        {
            List<PRC_DTP_MENU_GET_PERMISSION_GETCHILD_BYMENUIDResult> result = new List<PRC_DTP_MENU_GET_PERMISSION_GETCHILD_BYMENUIDResult>();
            result = PRC_DTP_MENU_GET_PERMISSION_GETCHILD_BYMENUID(menuparent,MsBoPhan).ToList();
            return result;
        }
        catch (Exception ex)
        {
            return null;
        }
    }
    public int Menu_Properties_Insert(int MSBoPhan,string  DSMenuID)
    {
        try
        {
            return PRC_DTP_MENU_PROPERTIES_INSERT(MSBoPhan,DSMenuID);

        }
        catch
        {
            return -1;
        }
    }

}